package com.useeinfo.oa.common.utils.exception.view;

import com.useeinfo.oa.common.exception.dto.ExceptionDto;
import com.useeinfo.oa.common.utils.exception.JudgmentView;
import org.springframework.http.HttpStatus;

/**
 * @author geniusj
 * @email 97547185@qq.com
 * @date 2018/8/20  下午2:38
 */
public class DefaultJudgmentView implements JudgmentView {

    private static final String EXCEPTION_VIEW =  "/error/500";

    private Exception exception;

    public DefaultJudgmentView(Exception exception) {
        this.exception = exception;
    }

    @Override
    public ExceptionDto getViewDetail() {
        return new ExceptionDto(exception, "服务器异常", HttpStatus.INTERNAL_SERVER_ERROR,EXCEPTION_VIEW);
    }
}
